/**
 * 
 */
package functii.trigonometrice;

import Interpretor.Context;
import functii.Functie;

public class Sin extends Functie {
/*
	public static double Calcul(double aux1) {
		if (Math.cos(aux1) == 1)
			return 0;
		return Math.sin(aux1);
	}

	public double calcul() {
		if (fStang == null)
			System.exit(1);
		return Calcul(fStang.calcul());
	}

	public double calculDerivata() {
		if (fStang == null)
			System.exit(1);
		return Ori.Calcul(fStang.calculDerivata(), Cos.Calcul(fStang.calcul()));
	}

	public String derivare() {
		if (fStang == null)
			System.exit(1);

		return Ori.ConcatTermeni(fStang.derivare(), Cos.concatTermeni(fStang
				.toString()));
	}

	public String toString() {
		if (fStang == null)
			System.exit(1);
		return concatTermeni(fStang.toString());
	}
*/
	public void interpret(Context cont) {
		cont.actual(this);
	}
	public static String ConcatTermeni(String aux1) {
		System.out.println("CONCATENEZ SIN");
		String aux;
		int nrP;
		nrP = aux1.charAt(0) == '(' ? 0 : 2;
		aux = "sin";
		if (nrP != 0)
			aux += "(";
		aux += aux1;
		if (nrP != 0)
			aux += ")";
		return aux;
	}
	
	public String concatTermeni(String aux1) {
		String aux;
		int nrP;
		nrP = aux1.charAt(0) == '(' ? 0 : 2;
		aux = "sin";
		if (nrP != 0)
			aux += "(";
		aux += aux1;
		if (nrP != 0)
			aux += ")";
		return aux;
	}

}
